package controller.KeyListeners;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.HashMap;

import javax.swing.KeyStroke;
import controller.Controller;
public class SelectionKeyListener extends KeyboardListener{
        private Controller controller;
	public SelectionKeyListener(Controller controller){
                setController(controller);
		keyBindings.put(KeyStroke.getKeyStroke(48,0), new Action(){
			//TODO
			//Code for 0 selection input
			public void perform() {
                                exe(0);
				System.out.println("0 selection input");
			}
		});
		keyBindings.put(KeyStroke.getKeyStroke(49,0), new Action(){
			//TODO
			//Code for 1 selection input
			public void perform() {
                                exe(1);
				System.out.println("1 selection input");
			}
		});
		keyBindings.put(KeyStroke.getKeyStroke(50,0), new Action(){
			//TODO
			//Code for 2 selection input
			public void perform() {
                                exe(2);
				System.out.println("2 selection input");
			}
		});
		keyBindings.put(KeyStroke.getKeyStroke(51,0), new Action(){
			//TODO
			//Code for 3 selection input
			public void perform() {
                                exe(3);
				System.out.println("3 selection input");
			}
		});
		keyBindings.put(KeyStroke.getKeyStroke(52,0), new Action(){
			//TODO
			//Code for 4 selection input
			public void perform() {
                                exe(4);
				System.out.println("4 selection input");
			}
		});
		keyBindings.put(KeyStroke.getKeyStroke(53,0), new Action(){
			//TODO
			//Code for 5 selection input
			public void perform() {
                                exe(5);
				System.out.println("5 selection input");
			}
		});
		keyBindings.put(KeyStroke.getKeyStroke(54,0), new Action(){
			//TODO
			//Code for 6 selection input
			public void perform() {
                                exe(6);
				System.out.println("6 selection input");
			}
		});
		keyBindings.put(KeyStroke.getKeyStroke(55,0), new Action(){
			//TODO
			//Code for 7 selection input
			public void perform() {
                                exe(7);
				System.out.println("7 selection input");
			}
		});
		keyBindings.put(KeyStroke.getKeyStroke(56,0), new Action(){
			//TODO
			//Code for 8 selection input
			public void perform() {
                                exe(8);
				System.out.println("8 selection input");
			}
		});
		keyBindings.put(KeyStroke.getKeyStroke(57,0), new Action(){
			//TODO
			//Code for 9 selection input
			public void perform() {
                                exe(9);
				System.out.println("9 number command input");
			}
		});
	}
        private void exe(int number){
            controller.cycleInstance(number);
        }
        private void setController(Controller controller){
            this.controller = controller;
        }
}
